package test.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import test.service.IGenTableService;


/**
 * Describe: 代码生成控制器
 * Author: 就 眠 仪 式
 * CreateTime: 2019/10/23
 */
@Controller
@RequestMapping("/code")
public class GenController {

    private String prefix = "generate/";

    @Autowired
    private IGenTableService genTableService;




    /**
     * 生成代码
     *
     * @param tableName 表格名称
     */
    @GetMapping("/genCode/{tableName}")
    @ResponseBody
    public String genCode(@PathVariable("tableName") String tableName) {
        genTableService.generatorCode(tableName);
        return "代码生成成功";
    }
}